package com.zst.dollars.handler.client;

import com.zst.dollars.common.Consts;
import com.zst.dollars.entity.msg.ServerMsgResponseMessage;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MsgResponseHandler extends SimpleChannelInboundHandler<ServerMsgResponseMessage> {
    private static final Logger logger = LoggerFactory.getLogger(MsgResponseHandler.class);
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, ServerMsgResponseMessage msg) throws Exception {
        logger.debug("收到发送消息的回复确认");
        ctx.channel().attr(Consts.smeaphoreKey).get().release();
    }
}
